﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="AdminUserAdd.ascx.cs" Inherits="webUserControl_AdminUserAdd" %>
<div class="code">
<table style="width:80%; line-height:25px; font-size:12px;">
    <tr>
        <td style="text-align:right; padding-right:5px; width:120px;">用户名：</td>
        <td style=" padding-left:5px;">
            <asp:TextBox ID="tbAdminName" runat="server" ></asp:TextBox>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
                ControlToValidate="tbAdminName" ErrorMessage="*" ValidationGroup="A"></asp:RequiredFieldValidator>
                </td>
    </tr>
    <tr>
        <td style="text-align:right; padding-right:5px; width:120px;">密码：</td>
        <td style=" padding-left:5px;">
            <asp:TextBox ID="tbPassWD" runat="server" TextMode="Password"></asp:TextBox>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" 
                ControlToValidate="tbPassWD" ErrorMessage="*" ValidationGroup="A"></asp:RequiredFieldValidator></td>
    </tr>
    <tr>
        <td style="text-align:right; padding-right:5px; width:120px;">校验密码：</td>
        <td style=" padding-left:5px;">
            <asp:TextBox ID="tbPassWD2" runat="server" TextMode="Password"></asp:TextBox>
            <asp:CompareValidator ID="CompareValidator1" runat="server" 
                ControlToCompare="tbPassWD" ControlToValidate="tbPassWD2" 
                ErrorMessage="两次输入密码不一致" ValidationGroup="A"></asp:CompareValidator>
                </td>
    </tr>
    <tr>
        <td style="text-align:right; padding-right:5px; width:120px;">类型：</td>
        <td style=" padding-left:5px;">
            <asp:DropDownList ID="ddlisType" runat="server" AutoPostBack="True" 
                onselectedindexchanged="ddlisType_SelectedIndexChanged">
                
                <asp:ListItem Value="4">业务员</asp:ListItem>
                <asp:ListItem Value="3">地市操作员</asp:ListItem>
                <asp:ListItem Value="2">分公司经理</asp:ListItem>
                <asp:ListItem Value="1">系统管理员</asp:ListItem>
            </asp:DropDownList>
                </td>
    </tr>
    
   
    <tr>
        <td style="text-align:right; padding-right:5px; width:120px;">级别：</td>
        <td style=" padding-left:5px;">
            <asp:DropDownList ID="ddlIsLevel" runat="server" AutoPostBack="True" 
                onselectedindexchanged="ddlIsLevel_SelectedIndexChanged">
                <asp:ListItem Value="0">市级</asp:ListItem>
                <asp:ListItem Value="1">省级</asp:ListItem>
            </asp:DropDownList>
        </td>
    </tr>
    <asp:Panel ID="Panel2" runat="server">
    <tr>
        <td style="text-align:right; padding-right:5px; width:120px;">地区：</td>
        <td style=" padding-left:5px;">
            <asp:DropDownList ID="ddlCityID" runat="server" >
            </asp:DropDownList>
        </td>
    </tr>
     </asp:Panel>
    <tr>
        <td style="text-align:right; padding-right:5px; width:120px;">&nbsp;</td>
        <td style=" padding-left:5px;">
            <asp:Button ID="btnAdd" runat="server" onclick="btnAdd_Click" Text="添加" 
                ValidationGroup="A" />
                <asp:Literal ID="Literal1" runat="server"></asp:Literal>
                </td>
    </tr>
    </table>
</div>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
        ConnectionString="<%$ ConnectionStrings:LinFen %>" 
        
        SelectCommand="SELECT dbo.AdminInfo.ID, dbo.AdminInfo.AdminName, dbo.AdminType.typeName, dbo.sysLevel.sysLevel, dbo.sysCityName.CityName FROM dbo.AdminInfo INNER JOIN dbo.AdminType ON dbo.AdminInfo.isType = dbo.AdminType.ID INNER JOIN dbo.sysLevel ON dbo.AdminInfo.Flag = dbo.sysLevel.ID INNER JOIN dbo.sysCityName ON dbo.AdminInfo.CityID = dbo.sysCityName.ID WHERE (dbo.AdminInfo.isType &lt;&gt; 5) ORDER BY dbo.AdminInfo.ID DESC"></asp:SqlDataSource>
    <asp:GridView ID="GridView1" runat="server" AllowPaging="True" 
        AllowSorting="True" AutoGenerateColumns="False" CellPadding="4" 
        DataKeyNames="ID" DataSourceID="SqlDataSource1" Font-Size="12px" 
        ForeColor="#333333" GridLines="None" HorizontalAlign="Center" 
        onrowcommand="GridView1_RowCommand" Width="100%">
        <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
        <RowStyle BackColor="#F7F6F3" ForeColor="#333333" HorizontalAlign="Center" />
        <Columns>
            <asp:BoundField DataField="ID" HeaderText="编号" InsertVisible="False" 
                ReadOnly="True" SortExpression="ID" />
            <asp:BoundField DataField="AdminName" HeaderText="登录名" 
                SortExpression="AdminName" />
            <asp:BoundField DataField="typeName" HeaderText="级别" 
                SortExpression="typeName" />
            <asp:BoundField DataField="sysLevel" HeaderText="身份" 
                SortExpression="sysLevel" />
            <asp:BoundField DataField="CityName" HeaderText="城市" 
                SortExpression="CityName" />
            <asp:TemplateField ShowHeader="False">
                <ItemTemplate>
                    <asp:Button ID="Button1" runat="server" CausesValidation="False" 
                        CommandArgument='<%# Eval("ID") %>' CommandName="DEL" Text="删除" />
                </ItemTemplate>
            </asp:TemplateField>
        </Columns>
        <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
        <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
        <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
        <EditRowStyle BackColor="#999999" />
        <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
    </asp:GridView>
